package com.example.fristactivity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.Log;
import android.widget.EditText;

import java.text.BreakIterator;

public class ThirdActivity extends AppCompatActivity {
    private static final String TAG ="";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.third_layout);
        EditText edittext=(EditText) findViewById(R.id.editText);
    }
    @Override
    public void onSaveInstanceState(Bundle savedInstanceState){
        super.onSaveInstanceState(savedInstanceState);
        Log.d(TAG,"我正在被销毁，保存了一些数据");
        String tempData="Something you just typed";
        savedInstanceState.putString("message",tempData);
    }
    @Override
    public void onRestoreInstanceState (Bundle savedInstanceState){
        super.onRestoreInstanceState(savedInstanceState);
        String tempData = savedInstanceState.getString("message");
        Log.d(TAG,"tempData");
    }
}